1. Field of the Invention
The present invention relates to a video data compression apparatus for compressing and coding noncompressed video data and a method of same.
2. Description of the Related Art
When compressing and coding noncompressed digital video data in units of GOPs (groups of pictures) comprised of an I picture (intra-coded picture), a B picture (bi-directionally predictive coded picture), and a P picture (predictive coded picture) by a method such as the MPEG (Moving Picture Experts Group) and recording the same on a recording medium such as a magneto-optical disc (MO disc) or transmitting the same via communication line, it is necessary to control the amount of data (amount of bits) of the compressed video data after the compression and coding to be not more than the recording capacity of the recording medium or not more than the transmission capacity of the communication line while holding the quality of the image after expansion and decoding high.
For this purpose, first, there is adopted a method of preliminarily compressing and coding the noncompressed video data to estimate the amount of data after the compression and coding (first pass), then adjusting the compression rate based on the estimated amount of data and performing the compression and coding so that the amount of data after the compression and coding becomes not more than the recording capacity of the recording medium by (second pass) (hereinafter, such a compression and coding method will be also referred to as xe2x80x9ctwo pass encodingxe2x80x9d).
However, if performing the compression and coding by the two pass encoding, it is necessary to apply similar compression and coding processing two times with respect to the same noncompressed video data, so a long time is taken. Further, since the final compressed video data cannot be calculated by one compression and coding processing, the shot video data cannot be compressed, coded, recorded, or transmitted in real time as it is.
An object of the present invention is to provide a video data compression apparatus with which the audio and/or video data can be compressed and coded to a predetermined amount of data or less not by the two pass encoding and a method of the same.
Further, another object of the present invention is to provide a video data compression apparatus with which the video data can be compressed and coded in almost real time and in addition with which a high quality image can be obtained after the expansion and decoding and a method of the same.
Further, still another object of the present invention is to provide a video data compression apparatus with which the compression and coding processing can be carried out by adjusting the compression rate by estimating the amount of data after the compression and coding not by the two pass encoding and a method of the same.
According to a first aspect of the present invention, there is provided a video data compression apparatus having an indicator data calculating means for calculating indicator data indicating a complexity of video data for every picture from noncompressed video data; a target value calculating means for calculating a target value of an amount of data after compression of the video data for every picture based on the calculated indicator data; and a compressing means for compressing the noncompressed video data so that the amount of data after compression becomes the calculated target value.
According to a second aspect of the present invention, there is provided a data compression method comprising the steps of calculating indicator data indicating a complexity of video data for every picture from noncompressed video data; calculating a target value of an amount of data after compression of the video data for every picture based on the calculated indicator data; and compressing the video data by a predetermined compression method so that the amount of data after compression becomes the calculated target value.
According to a third aspect of the present invention, there is provide a video data compression apparatus having an indicator data calculating means for calculating indicator data indicating a complexity of video data for every picture; a difficulty data calculating means for performing a predetermined computation processing for multiplying a coefficient with the calculated indicator data to calculate difficulty data corresponding to the amount of data after compression of the video data; a target value calculating means for calculating a target value of the amount of data after compression of the video data for every picture based on the calculated difficulty data; a compressing means for compressing each of the pictures of the video data by a predetermined compression method so that the amount of data after compression becomes the calculated target value so as to generate compressed video data; and a coefficient updating means for updating the coefficient based on the amount of data of the generated compressed video data.
According to a fourth aspect of the present invention, there is provided a video data compression method comprising the steps of calculating indicator data indicating a complexity of video data for every picture; performing predetermined computation processing for multiplying a coefficient with the calculated indicator data to calculate difficulty data corresponding to the amount of data after compression; calculating a target value of the amount of data after compression of the noncompressed video data for every picture based on the calculated difficulty data; compressing each of the pictures of the video data by the compression method so that the amount of data after compression becomes the calculated target value so as to generate compressed video data; and updating the coefficient based on the amount of data of the generated compressed video data.
According to a fifth aspect of the present invention, there is provided a video data compression apparatus for compressing a continuous plurality of video data to compressed video data of a picture type sequence containing a plurality of types of pictures (I picture, P picture, and B picture) in a predetermined order, having a rearranging means for rearranging pictures of the noncompressed video data to an order adapted to the compression method so that each head picture of the video data becomes an I picture or a P picture; an indicator data calculating means for calculating indicator data indicating a complexity of the rearranged noncompressed video data for every picture; a border detecting means for detecting a scene change of a continuous plurality of the noncompressed video data; a changing means for changing the picture type sequence so that pictures of any of the noncompressed video data are compressed without reference to the pictures of the other noncompressed video data for every border of a detected scene change; a target value calculating means for calculating a target value of the amount of data after compression of the video data based on the calculated indicator data and the picture type sequence after change; and a compressing means for compressing the video data to compressed video data of the picture type sequence after change so that the amount of data after compression becomes substantially the calculated target value.
According to a sixth aspect of the present invention, there is provided a video data compression method for compressing a continuous plurality of video data to compressed video data of a picture type sequence containing a plurality of types of pictures (I picture, P picture, and B picture) in a predetermined order, comprising the steps of rearranging pictures of the noncompressed video data to an order adapted to the compression method so that each head picture of the video data becomes an I picture or a P picture; calculating indicator data indicating a complexity of the rearranged noncompressed video data for every picture; detecting a scene change of the continuous plurality of the noncompressed video data; changing the picture type sequence so that a picture of any of the noncompressed video data is compressed without reference to a pictures of other noncompressed video data for every border of a detected scene change; calculating a target value of the amount of data after compression of the video data for every predetermined compression unit based on the calculated indicator data and the picture type sequence after change; and compressing the video data to the compressed video data of the picture type sequence after change so that the amount of data after compression becomes substantially the calculated target value.
Note that flatness is defined as an indicator representing a spatial flatness of van image, represents the complexity of the image, and has a correlation with the difficulty (degree of difficulty) of the pattern of the image and the amount of data after compression.
Further, an intra AC is defined as the sum of the dispersion values of the average value of the video data in the pictures and the video data for every DCT block of the DCT processing unit in the MPEG system, represents the complexity of the image, and has a correlation with the difficulty (degree of difficulty) of the pattern of the image and the amount of data after compression similar to the flatness.
Further, an ME residual is defined as the sum of absolute values or the sum of square values of the difference of the video data between the input picture and a reference picture after motion compensation processing by the motion vector at the compression and coding, represents the speed of the motion of the image and the complexity of the pattern, and has a correlation with the difficulty (degree of difficulty) of the pattern of the image and the amount of data after compression similar to the flatness.
Further, the activity is defined as the activity used for determining a quantization value of quantization processing with respect to a macroblock in TM5 [test model 5; ISO/IEC JTC/SC29 (1993)] famous as a compression algorithm of the MPEG system.